<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<link rel="stylesheet" href="/static/plugins/layui/css/layui.css">
    <script type="text/javascript" src="/static/plugins/layui/layui.js"></script>
	<style type="text/css">
		.header span{
			background:#009680; 
			font-size: 18px;
			margin-left: 10px;
			padding: 5px;
		}
	</style>
</head>
<body style="padding: 10px;">
	<div class="header">
		<span>资费标签</span>
		<hr style="border: solid 1px;">
	</div>
	<form class="layui-form" >

		<input type="hidden" name="flag" value="charge">

	<table class="layui-table">
		<thead>
			<tr>
				<th>ID</th>
				<th>排序</th>
				<th>标签名称</th>
				<th>是否禁用</th>
			</tr>
		</thead>
		<tbody>
			{volist name="data.lists" id="vo"}
			<tr>
				<td>{$vo.id}</td>
				<td><input type="text" name="ord[{$vo.id}]" class="layui-input" value="{$vo.ord}"></td>
				<td><input type="text" name="title[{$vo.id}]" class="layui-input" value="{$vo.title}"></td>
				<td>
					<input type="checkbox" name="status[{$vo.id}]" lay-skin="primary" title="禁用" 
					{$vo.status?'checked':''} value=1>
				</td>
			</tr>
			{/volist}

			<tr>
				<td></td>
				<td><input type="text" name="ord[0]" class="layui-input" value=""></td>
				<td><input type="text" name="title[0]" class="layui-input" value=""></td>
				<td>
					<input type="checkbox" name="status[0]" lay-skin="primary" title="禁用" 
					 value=1>
				</td>
			</tr>
		</tbody>
	</table>
	</form>
	<button class="layui-btn" onclick="save()">保存</button>


<script type="text/javascript">
		layui.use(['layer','form'],function(){
		layer=layui.layer;
		form=layui.form;
		$=layui.jquery;
	});	


	//保存，编辑删除添加
	function save(){
		$.post('/admins.php/admins/Labels/save',$('form').serialize(),function(res){
			if(res.code>0){
					layer.alert(res.msg,{'icon':2});
				}else{
					layer.msg(res.msg);
					setTimeout(function(){window.location.reload();},1000);
				}
		},'json');

	}
</script>
	
</body>
</html>
